<%@page import="javax.naming.NamingException"%>
<%@page import="java.util.Iterator"%>
<%@page import="ecom.beans.ProductstoreBean"%>
<%@page import="java.util.Set"%>
<%@page import="ecom.beans.EcomAdminRemote"%>
<%@page import="javax.naming.InitialContext"%>
<div class="infoBoxWrapper box5">	
    <div class="box4">
        <div class="border-top3">
            <div class="border-right3">
                <div class="border-bot3">
                    <div class="border-left3">
                        <div class="border-left3">
                            <div class="left-top-corner3">
                                <div class="right-top-corner3">
                                    <div class="right-bot-corner3">
                                        <div class="left-bot-corner3">
                                            <div class="inner4">  
                                                <div class="infoBoxHeading">Magasins
                                                </div>  
                                                <div class="infoBoxContents">
                                                    <form name="productstores" action="Controleur" method="get">
                                                        <input type="hidden" value="list_productsstore" name="action" />
                                                        <select name="idProductstore" onchange="this.form.submit();" size="1" class="select">
                                                            <%
                                                                Long idProductstore = (Long) session.getAttribute("idProductstore");
                                                                if (idProductstore != null) {
                                                                    out.print("<option value='0'>Tous les magasins</option>");
                                                                } else {
                                                                    out.print("<option selected='selected' value='0'>Tous les magasins</option>");
                                                                }
                                                                Set<ProductstoreBean> productstores =
                                                                        (Set<ProductstoreBean>) request.getSession().getAttribute("productstores");
                                                                Iterator<ProductstoreBean> it = productstores.iterator();
                                                                while (it.hasNext()) {
                                                                    ProductstoreBean e = it.next();

                                                                    if (idProductstore != null) {
                                                                        if (idProductstore.equals(e.getIdProductStore())) {
                                                                            out.print("<option selected='selected' value='" + e.getIdProductStore() + "'>" + e.getName() + "</option>");
                                                                        } else {
                                                                            out.print("<option value='" + e.getIdProductStore() + "'>" + e.getName() + "</option>");
                                                                        }
                                                                    } else {
                                                                        out.print("<option value='" + e.getIdProductStore() + "'>" + e.getName() + "</option>");
                                                                    }
                                                                }
                                                            %>
                                                        </select>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>